home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume24 / policy < prev    next >
Encoding:
Internet Message Format  |  1991-03-05  |  20.0 KB

  1. Subject:  v24i024:  Scripts for setting site policies
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 4bd55220 d00136f4 2c211cec 00fdfbc3
  5.  
  6. Submitted-by: Bud Hovell <bh@mtek.mtek.com>
  7. Posting-number: Volume 24, Issue 24
  8. Archive-name: policy
  9.  
  10. [  This is a rather interesting submission.  Should I have posted it?
  11.    Send me email.  --r$  ]
  12.  
  13. The need for more-formal policy definition seems to be gaining increasing
  14. recognition as a real problem at many sites, and this little package is an
  15. attempt to give SAs a leg up on addressing that concern by providing them
  16. some basic tools and suggestions.
  17.  
  18. Rob Kolstad has made reference to this package on two occasions in his
  19. column, and Bjorn Satdeva at Sysadmin, Inc., has mentioned it also in the
  20. sysadmin subscriber list.
  21.  
  22. Consequently, I have had a number of requests for it - and it may be time
  23. to make this info more-generally accessible.  Let me say, though, that if
  24. you feel it is *not* an appropriate addition, then it isn't going to hurt
  25. my feelings if you reject it.  :-)
  26.  
  27. This is the latest version, which is a *vast* improvement over some of the
  28. earlier scripts. Hopefully, it will run on all common machines, but I am
  29. not certain, since my limited experience is only with sysv. Suggestions
  30. are welecome.
  31.  
  32. Bud Hovell
  33.  
  34. #! /bin/sh
  35. # This is a shell archive.  Remove anything before this line, then unpack
  36. # it by saving it into a file and typing "sh file".  To overwrite existing
  37. # files, type "sh file -c".  You can also feed this as standard input via
  38. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  39. # will see the following message at the end:
  40. #        "End of archive 1 (of 1)."
  41. # Contents:  1stlogin.ann MANIFEST README gen logins policy usenet
  42. # Wrapped by bbh@mtek.com on Fri Mar  1 22:50:16 1991
  43. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  44. if test -f '1stlogin.ann' -a "${1}" != "-c" ; then 
  45.   echo shar: Will not clobber existing file \"'1stlogin.ann'\"
  46. else
  47. echo shar: Extracting \"'1stlogin.ann'\" \(2394 characters\)
  48. sed "s/^X//" >'1stlogin.ann' <<'END_OF_FILE'
  49. X# $Id: 1stlogin.ann,v 1.10 91/02/07 09:55:17 bbh Rel $
  50. X# Tell the new user what the rules are:
  51. X
  52. X# Give him a temp terminal for this script, which is run from /etc/profile:
  53. XTERM=vt100
  54. Xexport TERM
  55. X
  56. Xdone=
  57. Xuntil [ "$done" = "yes" ];do
  58. X    # Clear the screen
  59. X    tput clear
  60. X    cat << "END_PAGE_1"
  61. X
  62. X                                WELCOME!!!
  63. X
  64. XFirst, you should invoke 'menu' from the command line, then select 'policy' 
  65. Xto review the basic policies which govern the operation of this system and
  66. Xwho is responsible for what.
  67. X
  68. XIf a policy has provisions with which you do not agree, please notify the
  69. Xadministrator AT ONCE voicing your concerns/suggestions. Absent such notice,
  70. Xyou are assumed to have reviewed, understood, and agreed to conform to all
  71. Xwritten policy prevailing during any period you have authorized access to
  72. Xthis host, as evidenced by your continuing to log in.
  73. X
  74. XIf policies are significantly changed at any time, you will be sent email
  75. Xto inform you that a change has been effected, *or* there will be an announce-
  76. Xment in the system 'news' that will show up when you log in.
  77. X
  78. X[ You are responsible for reading all system 'news' messages containing the
  79. Xword "policy", since these will contain information effecting specific policy 
  80. Xchanges, which should occur rarely. ]
  81. X
  82. XEND_PAGE_1
  83. X        echo "                                     (Touch 'RETURN' to continue)"
  84. X    read nothing
  85. X    cat << "END_PAGE_2"
  86. X
  87. XAn initial .profile and .kshrc are provided for your convenience. If you 
  88. Xwant to see the special (read "usenet") features available on this machine,
  89. Xmost of them have man pages, and 'manlist' will give you a brief list of
  90. Xwhat non-AT&T commands are available. Detail, of course, can be gotten
  91. Xby reading the man pages themselves.
  92. X
  93. XAgain, welcome to 'mtek' - if we can assist you in any way, please let us
  94. Xknow!
  95. X
  96. XEND_PAGE_2
  97. X
  98. X    echo "Do you wish to re-read this message? [y]/n > \c"
  99. X    read done
  100. X    case $done in
  101. X         y*|Y*|"") # No -wants to see it again
  102. X                :
  103. X            ;;
  104. X                *) # He's done
  105. X                done="yes"
  106. X                break
  107. X            ;;
  108. X    esac
  109. Xdone
  110. X
  111. X# Make a permanent record that this user has seen this announcement
  112. Xrecord="$HOME/..."
  113. Xecho "Announcement presented to this user, '$LOGNAME.'" > $record
  114. Xchmod 440  $record
  115. Xchgrp root $record 
  116. Xchown root $record 
  117. X
  118. X# Clear the screen
  119. Xtput clear
  120. X
  121. X# Take away the temp terminal (user's .profile will supply the real one
  122. X# hereafter):
  123. XTERM=
  124. Xexport TERM
  125. X
  126. X# end of file
  127. END_OF_FILE
  128. if test 2394 -ne `wc -c <'1stlogin.ann'`; then
  129.     echo shar: \"'1stlogin.ann'\" unpacked with wrong size!
  130. fi
  131. # end of '1stlogin.ann'
  132. fi
  133. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  134.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  135. else
  136. echo shar: Extracting \"'MANIFEST'\" \(527 characters\)
  137. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  138. X   File Name        Archive #    Description
  139. X-----------------------------------------------------------
  140. X 1stlogin.ann               1    1st notice for new login users
  141. X MANIFEST                   1    This shipping list
  142. X README                     1    Information on the use of this stuff
  143. X gen                        1    Example: general policy
  144. X logins                     1    Example: specific user responsibilities
  145. X policy                     1    Executable: policy shell script
  146. X usenet                     1    Example: policy regarding new hookups
  147. END_OF_FILE
  148. if test 527 -ne `wc -c <'MANIFEST'`; then
  149.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  150. fi
  151. # end of 'MANIFEST'
  152. fi
  153. if test -f 'README' -a "${1}" != "-c" ; then 
  154.   echo shar: Will not clobber existing file \"'README'\"
  155. else
  156. echo shar: Extracting \"'README'\" \(2844 characters\)
  157. sed "s/^X//" >'README' <<'END_OF_FILE'
  158. X$Id: README,v 1.8 91/03/01 22:39:36 bbh Rel $
  159. X
  160. XWhat is in this package and how to use it:
  161. X^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  162. XThe file '1stlogin.ann' (first-login annnouncement) is something we call
  163. Xfrom /etc/profile by adding this entry:
  164. X
  165. X   if [ -r /usr/local/etc/1stlogin.ann -a ! -f $HOME/... ]
  166. X   then . /usr/local/etc/1stlogin.ann
  167. X   fi
  168. X
  169. X...which tests to see if the '...' file exists in the user's home 
  170. Xdirectory, and presents him with the announcement if it does not. This
  171. Xassures that every new user, on first login, gets the instructions 
  172. Xregarding his responsibility to read, understand, and comply with local
  173. Xpolicy. It directs him to the use of the 'policy' command to become
  174. Xand stay current on in-house policy. You may choose to use it or not.
  175. XIf you do, this file should be set to 444 to make it read-only.
  176. X
  177. XAll other files listed in the MANIFEST relate to the 'policy' script
  178. Xitself, or to the example policy text files it might call:
  179. X
  180. XMuch of the 'gen' file was outright lifted directly from the text of a 
  181. Xsimilar file used in one of the Canadian universities - have since for-
  182. Xgotten who/where was responsible (sorry). We have made a number of 
  183. Xchanges for local circumstances. You may wish to start with this as a
  184. Xtemplate for your own general policy statement.
  185. X
  186. XA few other text files are provided simply as examples of supplementary
  187. Xpolicy descriptions. Because I tend to be a hard-ass, they probably won't
  188. Xbe appropriate at your site, but the subjects may be some you wish to cover.
  189. X
  190. XThe executable file, 'policy', should be useful to you even if you decide
  191. Xto drop-kick the use of our example policy files, since it provides an easy
  192. Xway to manage a full screen of policy-file listings for selection by the
  193. Xuser. If you make improvements on this script, I'd sure like to see them
  194. Xso they can be incorporated into future revisions, with proper credit to
  195. Xyou for the contribution. Since I don't claim to know about all the various
  196. Xunixen out there (remember, I'm a 'suit', not a 'tech' :-), this script
  197. Xmay need minor modification for some non-sysV machines. So far, though, I
  198. Xhaven't gotten any complaints, so it must be working with most of them.
  199. X
  200. XInstallation: you must create the policy directory, by default named 'Policy',
  201. Xand within that directory an empty menu file, by default named 'polmenu',
  202. Xwhich must be set mode 666 (read and write for everyone). The directory also
  203. Xwill contain the individual policy text files that you create - see the
  204. Xinstructions in the 'policy' script for more info, if needed.
  205. X
  206. XOnce set up, the script automatically updates the menu any time a new text
  207. Xfile is added.  NOTE: in those instances that you may choose to *remove*
  208. Xa named text file, just empty the menu file and allow the script to rebuild
  209. Xa new menu of entries.
  210. X
  211. XHope this is useful to your purposes...bud@mtek.com
  212. END_OF_FILE
  213. if test 2844 -ne `wc -c <'README'`; then
  214.     echo shar: \"'README'\" unpacked with wrong size!
  215. fi
  216. # end of 'README'
  217. fi
  218. if test -f 'gen' -a "${1}" != "-c" ; then 
  219.   echo shar: Will not clobber existing file \"'gen'\"
  220. else
  221. echo shar: Extracting \"'gen'\" \(4492 characters\)
  222. sed "s/^X//" >'gen' <<'END_OF_FILE'
  223. Xgen     - general overview $Revision: 1.10 $ $Date: 91/02/06 12:48:51 $
  224. X^^^^^^^^^^^^^^^^^^^^^^^^^^
  225. X
  226. X                     USE OF MTEK COMPUTING FACILITIES
  227. X
  228. XThis host is privately owned and operated in support of a business. Business
  229. Xpriorities will thus be served first, if there is a conflict for time of the
  230. Xadministrator. We will be as helpful as conditions allow.
  231. X
  232. XWe run alot of usenet software on this host. So if you wonder if a desired
  233. Xcommand is in your PATH, type in 'which <command>'.
  234. X
  235. XTo find information about other users, use 'finger'. (Do 'man finger', if
  236. Xyou want to read the man page describing the use of 'finger').
  237. X
  238. XPlease furnish your office telephone number and extension so that we can enter
  239. Xit into the password file, available for 'finger' to find you. If you like,
  240. Xyou may also furnish your home number to be included, as well.
  241. X
  242. XBelow are presented the main elements of local policy, which apply to all
  243. Xusers:
  244. X
  245. X                     * * * * * * * * * * * * * * *
  246. X                     * Computer Resources Policy *
  247. X                     * * * * * * * * * * * * * * *
  248. X1. General
  249. X
  250. XComputing facilities are provided by MTEK International, Inc. (the "company")
  251. Xfor use by local and remote users.  It is expected that all users will make
  252. Xuse of local computing resources in a manner which is ethical, legal, and not
  253. Xcontrary to the interests of others, including the company.
  254. X
  255. XThe basic guidelines are that any use must be legal and not such as to 
  256. Xinterfere with use by other authorized users, nor compromise the confiden-
  257. Xtiality of the company's internal business practices or records.
  258. X
  259. X2.  Notice
  260. X
  261. XIf any policy has provisions with which you do not agree, please notify the
  262. Xadministrator describing your concerns/suggestions.  Absent such notice, it is
  263. Xassumed you have reviewed and understood, and fully agree to conform to, all
  264. Xprevailing published policies governing the use of this system.
  265. X
  266. X2. Disclaimer
  267. X
  268. X* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  269. X*                                                                         *
  270. X*    The company accepts NO RESPONSIBILITY for any damage to or loss of   *
  271. X*    data arising directly or indirectly from the use of these or other   *
  272. X*    facilities or for any consequential loss or damage.  It makes NO     *
  273. X*    WARRANTY, express or implied, regarding the computing services       *
  274. X*    offered, or their fitness for any particular purpose.                *
  275. X*                                                                         *
  276. X*    The company's liability in the event of any loss or damage shall     *
  277. X*    be LIMITED TO THE FEES AND CHARGES, IF ANY, PAID TO THE COMPANY      *
  278. X*    for use of the computing facilities which resulted in said loss      *
  279. X*    or damage.                                                           *
  280. X*                                                                         *
  281. X* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  282. X
  283. X3. Failure to abide by the policies described below and in related docu-
  284. Xments may result in denial of access to computing facilities:
  285. X
  286. X   A.    You may only use those facilities which have been authorized
  287. X    for your use. If access is protected by a password, you are not
  288. X    to make this password available to others. You may not use any
  289. X    account set up for another user, nor may you attempt to find out
  290. X    the password of another user.
  291. X
  292. X   B.    You may only use authorized facilities for authorized purposes.
  293. X
  294. X   C.    You must be aware of the law of copyright as it affects computer
  295. X    software. Software must not be copied except with the express
  296. X    permission of the copyright owner (which may be expressed in the
  297. X    copyright notice contained within the software). Note that a
  298. X    formal copyright need not be in evidence in order for copyright
  299. X    protection to be in force.
  300. X
  301. X   D.    You may not attempt to copy information belonging to other users
  302. X        without their express permission.
  303. X
  304. X   E.    You may not attempt to interfere with the operation of computing
  305. X    facilities.
  306. X
  307. X   F.    You may not attempt to subvert the security of any of the company's
  308. X    computing facilities.
  309. X
  310. X   G.    You may not use the company's computing facilities to send messages
  311. X    which are obscene or otherwise harassing in their intent.
  312. X
  313. X   H.   You may disagree with one or more of these policies, publically or
  314. X    privately, in accordance with your First Amendment rights, but you
  315. X    may not violate any of these policies for any reason or purpose.
  316. END_OF_FILE
  317. if test 4492 -ne `wc -c <'gen'`; then
  318.     echo shar: \"'gen'\" unpacked with wrong size!
  319. fi
  320. # end of 'gen'
  321. fi
  322. if test -f 'logins' -a "${1}" != "-c" ; then 
  323.   echo shar: Will not clobber existing file \"'logins'\"
  324. else
  325. echo shar: Extracting \"'logins'\" \(1711 characters\)
  326. sed "s/^X//" >'logins' <<'END_OF_FILE'
  327. Xlogins  - responsibilities of users $Revision: 1.4 $ $Date: 90/12/18 19:43:56 $
  328. X^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  329. XThis section should be considered as an extension of the 'gen' file which
  330. X    contains the general policies governing local computer usage.
  331. X
  332. XWhile it is not the intent of local policy to restrict unduly the exercise
  333. X    of free and unbounded communication, it is to be likewise clearly
  334. X    understood that no one having login privileges on this host has any
  335. X    "right of free speech" whatsoever as it relates to exercise of that
  336. X    privilege.
  337. X    
  338. XBecause any login user has actual (or potential) access to usenet, the
  339. X    administrator reserves the absolute and unfettered right to terminate,
  340. X    with or without stated cause, any login which may have been granted
  341. X    on this host at any time.
  342. X    
  343. XThis policy exists primarily to provide recourse to the administrator in the
  344. X    event a login user creates traffic onto the usenet which is considered
  345. X    *by the administrator* to be of such character as to create a negative
  346. X    reputation for this site and/or its management. Such actions will not
  347. X    be tolerated.
  348. X    
  349. XReceipt of messages from other *system administrators* (not users) register-
  350. X    ing complaints about a local user will be considered compelling
  351. X    evidence that the login should be withdrawn. Except....
  352. X
  353. XIt is true that it is relatively simple (if one has root privilege on a host)
  354. X    to create 'bogus' mail. Any login user who believes that someone has
  355. X    sent bogus mail under his name and this site name should notify the
  356. X    administrator immediately. These events, while rare, do happen, and
  357. X    are a recognized risk faced by everyone. A plea of "I didn't DO it"
  358. X    will usually prove to be a fully adequate defense....:-)
  359. END_OF_FILE
  360. if test 1711 -ne `wc -c <'logins'`; then
  361.     echo shar: \"'logins'\" unpacked with wrong size!
  362. fi
  363. # end of 'logins'
  364. fi
  365. if test -f 'policy' -a "${1}" != "-c" ; then 
  366.   echo shar: Will not clobber existing file \"'policy'\"
  367. else
  368. echo shar: Extracting \"'policy'\" \(2837 characters\)
  369. sed "s/^X//" >'policy' <<'END_OF_FILE'
  370. X# $Id: policy,v 1.19 91/01/16 10:55:28 bbh Rel $
  371. X#
  372. X# Author: Bud Hovell <bud@mtek.com>
  373. X#         MTEK International, Inc.
  374. X#         311 B Avenue - Suite 200
  375. X#         Lake Oswego, OR    97034
  376. X#
  377. X################################# edit these ################################
  378. Xpoldir=/usr/local/adm/Policy        # Where named policy files live.
  379. Xpager=/usr/local/bin/less        # Your favorite pager.
  380. Xmyname="uuname -l"                      # How to get local host name[
  381. Xtmp=/tmp                                # Preferred tmp directory
  382. X################################ edit no more ###############################
  383. X# Note: any policy file must be named identically to the first word of the
  384. X#     first line in the file itself. Consider the file "logins", with
  385. X#    this as line one (or the last line if you must use 'tail', see
  386. X#       above) :
  387. X#
  388. X#    logins  - responsibilities of users
  389. X#
  390. X#    .....where the word "logins" begins at character one of line
  391. X#       one of the file named "logins". This first line will then be
  392. X#       extracted to the ad-hoc menu file to provide the menu id for
  393. X#       the user to select the "logins" policy file.
  394. X
  395. X# Some variables:
  396. Xhost=`$myname | tr [a-z] [A-Z]`       
  397. Xmenu=$poldir/polmenu
  398. X
  399. X# Do we have a "clear" function?
  400. Xif [ -x /bin/clear -o -x /usr/bin/clear ]
  401. Xthen clear=`clear`
  402. X# ....or curses?
  403. Xelif  [ -x /usr/bin/tput ]
  404. Xthen clear=`tput clear`
  405. Xelse clear=
  406. Xfi
  407. X# WORK
  408. X# Any files newer than menu?
  409. Xcd $poldir 
  410. Xnew=`find . -newer $menu -print`
  411. X
  412. X# If so, menu needs to be updated:
  413. Xif [ "$new" != "" ]
  414. Xthen echo "\nOoops...hold on while I build a new menu for '$0'...\n" 
  415. X     > $menu
  416. X     filelist=`ls | sed -e 's/polmenu//g' \
  417. X            -e 's/^[     ]$//g' \
  418. X                        -e 's/$//g'; echo "\n"`
  419. X     for file in $filelist
  420. X     do
  421. X          echo "               \c"                          >> $menu
  422. X          # This will read out all of line 1 into the user menu,
  423. X          # except for any trailing Id or Header stuff for RCS
  424. X      # (if you show your revision info on line one):
  425. X          cat $file | sed -n '1p' | cut -d"$" -f1 >> $menu
  426. X     done
  427. Xfi
  428. X
  429. X# WORK
  430. X
  431. X# Re-run the menu until 'quit' from user:
  432. Xi=x
  433. Xuntil [ $i = "q|Q" ]; do
  434. X
  435. Xecho $clear
  436. X
  437. Xecho "\n               DIRECTORY OF LOCAL POLICY FOR HOST '$host'\n"
  438. Xcat $menu
  439. Xecho "\n               .....or 'q'uit"
  440. Xecho "\n               To review a policy, type in subject: > \c"
  441. Xread i
  442. Xcase $i in
  443. Xq|Q) # Wants to quit
  444. X       echo "\n               Policy review concluded. Thanks for your interest.\n"
  445. X       break ;;
  446. X"")  # No entry
  447. X       i=x
  448. X       echo "\n               You must provide a name or 'q'uit.\007"
  449. X       sleep 2
  450. X       continue ;;
  451. X*)   # Wants another
  452. X       if [ -r $poldir/$i ]
  453. X       then $pager $poldir/$i
  454. X        i=x
  455. X       else echo "\n               You must provide a name or 'q'uit.\007"
  456. X        sleep 2
  457. X        i=x
  458. X       fi
  459. X       continue ;;
  460. Xesac
  461. Xdone
  462. END_OF_FILE
  463. if test 2837 -ne `wc -c <'policy'`; then
  464.     echo shar: \"'policy'\" unpacked with wrong size!
  465. fi
  466. chmod +x 'policy'
  467. # end of 'policy'
  468. fi
  469. if test -f 'usenet' -a "${1}" != "-c" ; then 
  470.   echo shar: Will not clobber existing file \"'usenet'\"
  471. else
  472. echo shar: Extracting \"'usenet'\" \(698 characters\)
  473. sed "s/^X//" >'usenet' <<'END_OF_FILE'
  474. Xusenet  - requests for connection $Revision: 1.5 $ $Date: 91/03/01 21:51:15 $
  475. X^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  476. X
  477. XUsenet connections to this host may be granted on a case-by-case basis,
  478. X    and shall not be considered unless the requesting system adminis-
  479. X    trator agrees to timely maintain a current usenet map for his/her
  480. X    host. Failure to fulfill this requirement will *certainly* result
  481. X    in termination of uucp connection.
  482. X
  483. XIf a new host login is granted, the administrator will bend every effort
  484. X    to assist in getting the connection working properly and, if it
  485. X    is necessary, filing a properly-documented uucp map.
  486. X
  487. XAny request for uucp connection should be mailed to postmaster@mtek.com.
  488. X
  489. X
  490. X
  491. X
  492. X
  493. X
  494. X
  495. X
  496. X
  497. END_OF_FILE
  498. if test 698 -ne `wc -c <'usenet'`; then
  499.     echo shar: \"'usenet'\" unpacked with wrong size!
  500. fi
  501. # end of 'usenet'
  502. fi
  503. echo shar: End of archive 1 \(of 1\).
  504. cp /dev/null ark1isdone
  505. MISSING=""
  506. for I in 1 ; do
  507.     if test ! -f ark${I}isdone ; then
  508.     MISSING="${MISSING} ${I}"
  509.     fi
  510. done
  511. if test "${MISSING}" = "" ; then
  512.     echo You have the archive.
  513.     rm -f ark[1-9]isdone
  514. else
  515.     echo You still need to unpack the following archives:
  516.     echo "        " ${MISSING}
  517. fi
  518. ##  End of shell archive.
  519. exit 0
  520.  
  521. exit 0 # Just in case...
  522.